package com.dragon.repository.domain.vo;

import com.dragon.common.model.Update;
import com.dragon.repository.entity.ContractArticleSon;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.dragon.common.util.BeanUtils;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Date;


/**
 * @author sy
 */
@Data
@ApiModel(value = "")
public class ContractArticleSonVO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "合同id")
    private Integer contractId;

    @ApiModelProperty(value = "条款id")
    private Integer articleId;



    @NotNull(groups = Update.class,message = "主键不能为空")
    public static ContractArticleSon convert(ContractArticleSonVO vo) {
        ContractArticleSon entity = new ContractArticleSon();
        BeanUtils.copyProperties(vo,entity);
        return entity;
    }
    public static List<ContractArticleSon> convertList(List<ContractArticleSonVO> list) {
        List<ContractArticleSon> resultList = new ArrayList<>();
        for (ContractArticleSonVO vo : list) {
            resultList.add(convert(vo));
        }
        return resultList;
    }
}
